﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using UOL.PagSeguro.TestServer.Properties;

namespace UOL.PagSeguro.TestServer.UI {
    public partial class SettingsForm : Form {
        public SettingsForm() {
            InitializeComponent();
            this.urlRetorno.Focus();
            this.urlRetorno.Text = Settings.Default.URL_Retorno;
            this.txtPorta.Text = Settings.Default.PORTA;
        }

        private void btnSave_Click(object sender, EventArgs e) {
            Settings.Default.URL_Retorno = this.urlRetorno.Text;
            Settings.Default.PORTA = this.txtPorta.Text;
            Settings.Default.Save();
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e) {
            this.Close();
        }

        private void SettingsForm_KeyDown(object sender, KeyEventArgs e) {
            if (e.KeyCode == Keys.Escape) {
                this.Close();
            }
        }
    }
}
